package com.itheima.d1_create_thread.ZengTest3;

import java.util.concurrent.Callable;

/**
 * @ClassName zengCallable
 * @Author 16799
 * @Date 2025/8/31 15:42
 * @Version 1.0
 * @Description TODO
 **/
public class zengCallable implements Callable<String> {

    private int z;
    public zengCallable(int z){
        this.z=z;
    }

    @Override
    public String call() throws Exception {
        int sum = 0;
        for (int i = 0; i < z; i++) {
            sum+=z;
        }
        return "实现callable接口创建的线程，返回求和： "+sum;
    }
}
